<?php
namespace Home\Model;
use Think\Model;

class MealCategoryModel extends Model
{
    public function getCatList($meal_id)
    {
        $meal_id = (int)$meal_id;
        $list = array();
        $sql = "SELECT B.* FROM `yiyou_meal_cats` A LEFT JOIN `yiyou_meal_category` B ON A.cat_id = B.id WHERE `meal_id` = $meal_id ";
        $res = $this->query($sql);
        foreach ($res as $item) {
            $list[$item['id']] = $item;
        }
        return $list;
    }
}